package com.oocl.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "food_ad")
@GenericGenerator(name = "foodad_uuid", strategy = "uuid")
public class FoodAd implements Serializable {
	
	@Id
	@Column(name="id",length=36)
	@GeneratedValue(generator="foodad_uuid")
	private String id;
	@JoinColumn(name="fid")
	@OneToOne
	private Foods food;
	@JoinColumn(name="icnum",referencedColumnName="icnum")
	@ManyToOne
	private Merchants merchant;
	@Column(name="status",length=1)
	private String status;//
	@Column(name="applyTime")
	@Temporal(TemporalType.TIMESTAMP)
	private Date applyTime;
	@Column(name="autitTime")
    @Temporal(TemporalType.TIMESTAMP)
	private Date autitTime;

	
	public FoodAd() {
		super();
	}

	public FoodAd(String id, Foods food, Merchants merchant, String status,
			Date applyTime, Date autitTime) {
		super();
		this.id = id;
		this.food = food;
		this.merchant = merchant;
		this.status = status;
		this.applyTime = applyTime;
		this.autitTime = autitTime;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Foods getFood() {
		return food;
	}

	public void setFood(Foods food) {
		this.food = food;
	}

	public Merchants getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchants merchant) {
		this.merchant = merchant;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getApplyTime() {
		return applyTime;
	}

	public void setApplyTime(Date applyTime) {
		this.applyTime = applyTime;
	}

	public Date getAutitTime() {
		return autitTime;
	}

	public void setAutitTime(Date autitTime) {
		this.autitTime = autitTime;
	}

}
